const Stock = require('../db/model/stock');
const cryptoHelper = require('../helper/crypto');

const add = async (name, code, shortcut) => {

    let record = await Stock.query().insert({
        name,
        code,
        shortcut
    });

    return record;
};

const get = async (id) => {

    let record = await Stock.query().findOne({id});

    return record;
};

const update = async (id, summary) => {

    let record = await Stock.query().update({summary}).where("id", id);

    return record;
};

module.exports = {
    add,
    get,
    update
};